package com.example.seckill.mapper;

import com.example.seckill.entity.TSeckillGoods;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author vicente
 * @since 2021-08-10
 */
public interface TSeckillGoodsMapper extends BaseMapper<TSeckillGoods> {

    @Update("update t_seckill_goods set seckill_num = seckill_num -1 where seckill_num > 0 and id = #{id}")
    int updateInventory(Long id);
}
